package com.suwish.pc.ui.component.list;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

/**
 * 
 * 
 * @author Min
 *
 */
public class PreferenceListCellRenderer implements ListCellRenderer {

	private Color selectColor = new Color(217, 228, 246);
	
	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		JLabel label = (JLabel)value;
		if (isSelected) {
			label.setBackground(selectColor);
			label.setForeground(Color.BLACK);
        }
        else {
        	label.setBackground(list.getBackground());
        	label.setForeground(list.getForeground());
        }
		return label;
	}

}
